My additions to library project - Bethel#2
Open
bfkade1 wants to merge 1 commit intoNBHS-STEM:checkout_bookfrom
Open
My additions to library project - Bethel#2bfkade1 wants to merge 1 commit intoNBHS-STEM:checkout_bookfrom
bfkade1 wants to merge 1 commit intoNBHS-STEM:checkout_bookfrom
Conversation
denricoNHS
reviewed
Dec 11, 2016
| # How can we *remove* an item from a dictionary? | ||
| # Write code to delete the book keyed by isbn in the space below | ||
|
|
||
| if 'isbn' in remove_book: |
Member
There was a problem hiding this comment.
remove_book isn't defined within the scope of the function, it's the name of the function.
denricoNHS
reviewed
Dec 11, 2016
| del remove_book['isbn'] | ||
| # Now write code that saves the new version of the data to your library | ||
| with open("replayScript.json", "w") as jsonFile: | ||
| jsonFile.write(json.dumps(data)) |
denricoNHS
reviewed
Dec 11, 2016
| # Now write code that saves the new version of the data to your library | ||
| with open("replayScript.json", "w") as jsonFile: | ||
| jsonFile.write(json.dumps(data)) | ||
| pass |
denricoNHS
reviewed
Dec 11, 2016
| # Do we need to return anything? | ||
| with open(filename) as f: | ||
| json.dump({'students':students,'books':books}, f) | ||
| pass |
Member
There was a problem hiding this comment.
Why is this line still here?
denricoNHS
reviewed
Dec 11, 2016
|
|
||
|
|
||
| f.__setitem__("filename",checked out) |
Member
There was a problem hiding this comment.
Do you know what the magic method, setitem does?
I'm pretty confident you haven't tested this.
denricoNHS
reviewed
Dec 11, 2016
| # And again save the data here | ||
|
|
||
| with open("replayScript.json", "w") as jsonFile: | ||
| jsonFile.write(json.dumps(data)) |
Member
There was a problem hiding this comment.
Another indentation error, and I think there's a simpler way to accomplish what you're trying to do here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.